//
//  BSSRunningWaterDetailTableViewCell.m
//  PreschoolEducation
//
//  Created by 李传铎 on 2020/11/14.
//  Copyright © 2020 李传铎. All rights reserved.
//

#import "BSSRunningWaterDetailTableViewCell.h"

@implementation BSSRunningWaterDetailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor clearColor];
        [self createUI];
        [self layoutUI];
    }
    return self;
}

- (void)createUI {
    [self.contentView addSubview:self.titleL];
    [self.contentView addSubview:self.timeL];
    [self.contentView addSubview:self.amountL];
    [self.contentView addSubview:self.stateL];
    
    
}

- (void)layoutUI {
    
    
    [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(12);
    }];
    
    [self.timeL mas_updateConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(self.titleL.mas_bottom).offset(15);
        make.bottom.mas_equalTo(-12);
    }];
    
    [self.amountL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.mas_equalTo(self.titleL.mas_centerY);
    }];
    
    [self.stateL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.mas_equalTo(self.timeL.mas_centerY);
    }];
    
}

- (UILabel *)titleL{
    if (!_titleL) {
        _titleL = [UILabel new];
        _titleL.text = @"服务订单";
        _titleL.textColor = colorCode(@"#333333");
        _titleL.font = [UIFont boldSystemFontOfSize:16];
    }
    return _titleL;
}
- (UILabel *)timeL{
    if (!_timeL) {
        _timeL = [UILabel new];
        _timeL.textAlignment = NSTextAlignmentLeft;
        _timeL.text = @"2019.12.18 18:53:00";
        _timeL.textColor = colorCode(@"#999999");
        _timeL.font = fontCount(12);
    }
    return _timeL;
}
- (UILabel *)amountL{
    if (!_amountL) {
        _amountL = [UILabel new];
        _amountL.textAlignment = NSTextAlignmentRight;
        _amountL.text = @"-¥100.00";
        _amountL.textColor = colorCode(@"#333333");
        _amountL.font = fontCount(16);
    }
    return _amountL;
}
- (UILabel *)stateL{
    if (!_stateL) {
        _stateL = [UILabel new];
        _stateL.textAlignment = NSTextAlignmentRight;
        _stateL.text = @"待使用";
        _stateL.textColor = colorCode(@"#666666");
        _stateL.font = fontCount(13);
    }
    return _stateL;
}
@end
